import request from '@/utils/request'

// 查询医院数据列表
export function listHospital(query) {
  return request({
    url: '/creditlife/hospital/list',
    method: 'get',
    params: query
  })
}

// 查询医院数据详细
export function getHospital(hospitalId) {
  return request({
    url: '/creditlife/hospital/' + hospitalId,
    method: 'get'
  })
}

// 新增医院数据
export function addHospital(data) {
  return request({
    url: '/creditlife/hospital',
    method: 'post',
    data: data
  })
}

// 修改医院数据
export function updateHospital(data) {
  return request({
    url: '/creditlife/hospital',
    method: 'put',
    data: data
  })
}

// 删除医院数据
export function delHospital(hospitalId) {
  return request({
    url: '/creditlife/hospital/' + hospitalId,
    method: 'delete'
  })
}
export function getDoctor(hospitalId) {
  return request({
    url: `/creditlife/hospital/${hospitalId}/doctors`, // 修正路径格式
    method: 'get'
  })
}
export function getDoctorSchedule(doctorId) {
  return request({
    url: `/creditlife/hospital/${doctorId}/doctorsSchedule`,
    method: 'get'
  })
}
export function appointDoctor(data) {
  return request({
    url: `/creditlife/hospital/appointment`,
    method: 'put',
    data: data
  })
}
export function getAppointmentList() {
  return request({
    url: `/creditlife/hospital/getAppointmentList`,
    method: 'put',
  })
}
export function cancelAppointment(data) {
  return request({
    url: `/creditlife/hospital/cancelAppointment`,
    method: 'put',
    data: data
  })
}
